const fp = require("fastify-plugin");
const md5 = require("blueimp-md5");
const key = require("../config/app");
async function routes(fastify, options) {
  const table = fastify.tables;
  fastify.get("/table/insert", async (req, reply) => {
    let pas = md5("123456", key.md5Key);
    // await this.tables.create({
    //   username: "test1",
    //   password: pas,
    //   uuid: "sad213",
    //   nickname: "aw",
    //   phone: "213213",
    //   weixin: "ss12",
    // });
    return {
      code: 0,
      msg: fastify,
      pass: pas,
    };
  });
}

module.exports = fp(routes);
